/*
** Lua binding: materialscript
** Generated automatically by tolua++-1.0.92 on Thu Jun  3 13:12:27 2010.
*/

#ifndef __cplusplus
#include "stdlib.h"
#endif
#include "string.h"

#include "tolua++.h"

/* Exported function */
TOLUA_API int  tolua_materialscript_open (lua_State* tolua_S);

#include "lua_material.h"

/* function to register type */
static void tolua_reg_types (lua_State* tolua_S)
{
}

/* get function: G3MS_Name */
#ifndef TOLUA_DISABLE_tolua_get_Name
static int tolua_get_Name(lua_State* tolua_S)
{
  tolua_pushcppstring(tolua_S,(const char*)G3MS_Name);
 return 1;
}
#endif //#ifndef TOLUA_DISABLE

/* set function: G3MS_Name */
#ifndef TOLUA_DISABLE_tolua_set_Name
static int tolua_set_Name(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
  tolua_Error tolua_err;
  if (!tolua_iscppstring(tolua_S,2,0,&tolua_err))
   tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
#endif
  G3MS_Name = ((string)  tolua_tocppstring(tolua_S,2,0))
;
 return 0;
}
#endif //#ifndef TOLUA_DISABLE

/* get function: G3MS_Shininess */
#ifndef TOLUA_DISABLE_tolua_get_Shininess
static int tolua_get_Shininess(lua_State* tolua_S)
{
  tolua_pushnumber(tolua_S,(lua_Number)G3MS_Shininess);
 return 1;
}
#endif //#ifndef TOLUA_DISABLE

/* set function: G3MS_Shininess */
#ifndef TOLUA_DISABLE_tolua_set_Shininess
static int tolua_set_Shininess(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
  tolua_Error tolua_err;
  if (!tolua_isnumber(tolua_S,2,0,&tolua_err))
   tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
#endif
  G3MS_Shininess = ((float)  tolua_tonumber(tolua_S,2,0))
;
 return 0;
}
#endif //#ifndef TOLUA_DISABLE

/* get function: G3MS_Reflectance */
#ifndef TOLUA_DISABLE_tolua_get_Reflectance
static int tolua_get_Reflectance(lua_State* tolua_S)
{
  tolua_pushnumber(tolua_S,(lua_Number)G3MS_Reflectance);
 return 1;
}
#endif //#ifndef TOLUA_DISABLE

/* set function: G3MS_Reflectance */
#ifndef TOLUA_DISABLE_tolua_set_Reflectance
static int tolua_set_Reflectance(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
  tolua_Error tolua_err;
  if (!tolua_isnumber(tolua_S,2,0,&tolua_err))
   tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
#endif
  G3MS_Reflectance = ((float)  tolua_tonumber(tolua_S,2,0))
;
 return 0;
}
#endif //#ifndef TOLUA_DISABLE

/* function: MS_SetAmbient */
#ifndef TOLUA_DISABLE_tolua_materialscript_SetAmbient00
static int tolua_materialscript_SetAmbient00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
     !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
     !tolua_isnumber(tolua_S,4,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,5,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  float r = ((float)  tolua_tonumber(tolua_S,1,0));
  float g = ((float)  tolua_tonumber(tolua_S,2,0));
  float b = ((float)  tolua_tonumber(tolua_S,3,0));
  float a = ((float)  tolua_tonumber(tolua_S,4,0));
  {
   MS_SetAmbient(r,g,b,a);
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'SetAmbient'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* function: MS_SetDiffuse */
#ifndef TOLUA_DISABLE_tolua_materialscript_SetDiffuse00
static int tolua_materialscript_SetDiffuse00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
     !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
     !tolua_isnumber(tolua_S,4,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,5,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  float r = ((float)  tolua_tonumber(tolua_S,1,0));
  float g = ((float)  tolua_tonumber(tolua_S,2,0));
  float b = ((float)  tolua_tonumber(tolua_S,3,0));
  float a = ((float)  tolua_tonumber(tolua_S,4,0));
  {
   MS_SetDiffuse(r,g,b,a);
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'SetDiffuse'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* function: MS_SetSpecular */
#ifndef TOLUA_DISABLE_tolua_materialscript_SetSpecular00
static int tolua_materialscript_SetSpecular00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
     !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
     !tolua_isnumber(tolua_S,4,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,5,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  float r = ((float)  tolua_tonumber(tolua_S,1,0));
  float g = ((float)  tolua_tonumber(tolua_S,2,0));
  float b = ((float)  tolua_tonumber(tolua_S,3,0));
  float a = ((float)  tolua_tonumber(tolua_S,4,0));
  {
   MS_SetSpecular(r,g,b,a);
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'SetSpecular'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* function: MS_SetEmission */
#ifndef TOLUA_DISABLE_tolua_materialscript_SetEmission00
static int tolua_materialscript_SetEmission00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
     !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
     !tolua_isnumber(tolua_S,4,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,5,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  float r = ((float)  tolua_tonumber(tolua_S,1,0));
  float g = ((float)  tolua_tonumber(tolua_S,2,0));
  float b = ((float)  tolua_tonumber(tolua_S,3,0));
  float a = ((float)  tolua_tonumber(tolua_S,4,0));
  {
   MS_SetEmission(r,g,b,a);
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'SetEmission'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* function: MS_AddTexture */
#ifndef TOLUA_DISABLE_tolua_materialscript_AddTexture00
static int tolua_materialscript_AddTexture00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isstring(tolua_S,1,0,&tolua_err) ||
     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  const char* filename = ((const char*)  tolua_tostring(tolua_S,1,0));
  TEXTURE_FILTER filter = ((TEXTURE_FILTER) (int)  tolua_tonumber(tolua_S,2,0));
  {
   MS_AddTexture(filename,filter);
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'AddTexture'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* function: MS_AddVertexShader */
#ifndef TOLUA_DISABLE_tolua_materialscript_AddVertexShader00
static int tolua_materialscript_AddVertexShader00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isstring(tolua_S,1,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  const char* filename = ((const char*)  tolua_tostring(tolua_S,1,0));
  {
   bool tolua_ret = (bool)  MS_AddVertexShader(filename);
   tolua_pushboolean(tolua_S,(bool)tolua_ret);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'AddVertexShader'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* function: MS_AddFragmentShader */
#ifndef TOLUA_DISABLE_tolua_materialscript_AddFragmentShader00
static int tolua_materialscript_AddFragmentShader00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isstring(tolua_S,1,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  const char* filename = ((const char*)  tolua_tostring(tolua_S,1,0));
  {
   bool tolua_ret = (bool)  MS_AddFragmentShader(filename);
   tolua_pushboolean(tolua_S,(bool)tolua_ret);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'AddFragmentShader'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* Open function */
TOLUA_API int tolua_materialscript_open (lua_State* tolua_S)
{
 tolua_open(tolua_S);
 tolua_reg_types(tolua_S);
 tolua_module(tolua_S,NULL,1);
 tolua_beginmodule(tolua_S,NULL);
  tolua_constant(tolua_S,"GTF_NEAREST",GTF_NEAREST);
  tolua_constant(tolua_S,"GTF_LINEAR",GTF_LINEAR);
  tolua_constant(tolua_S,"GTF_MIPMAP",GTF_MIPMAP);
  tolua_variable(tolua_S,"Name",tolua_get_Name,tolua_set_Name);
  tolua_variable(tolua_S,"Shininess",tolua_get_Shininess,tolua_set_Shininess);
  tolua_variable(tolua_S,"Reflectance",tolua_get_Reflectance,tolua_set_Reflectance);
  tolua_function(tolua_S,"SetAmbient",tolua_materialscript_SetAmbient00);
  tolua_function(tolua_S,"SetDiffuse",tolua_materialscript_SetDiffuse00);
  tolua_function(tolua_S,"SetSpecular",tolua_materialscript_SetSpecular00);
  tolua_function(tolua_S,"SetEmission",tolua_materialscript_SetEmission00);
  tolua_function(tolua_S,"AddTexture",tolua_materialscript_AddTexture00);
  tolua_function(tolua_S,"AddVertexShader",tolua_materialscript_AddVertexShader00);
  tolua_function(tolua_S,"AddFragmentShader",tolua_materialscript_AddFragmentShader00);
 tolua_endmodule(tolua_S);
 return 1;
}


#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
 TOLUA_API int luaopen_materialscript (lua_State* tolua_S) {
 return tolua_materialscript_open(tolua_S);
};
#endif

